﻿@model IEnumerable<IRIS.Models.Link>

@{
    ViewBag.Title = "IRIS Ættleiðingartengd fræðsla : Hlekkir";
}

<h2>Hlekkir</h2>

@if (Model.Count() > 0)
{
<table>
    <tr>
        <th>
            Titill
        </th>
        <th>
            URL Slóð
        </th>
        <th>
            Lýsing
        </th>
        @if (User.IsInRole("Stjórnendur"))
        {
        <th>
            Stjórnborð
        </th>}
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.URL)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Description)
            </td>
            @if (User.IsInRole("Stjórnendur"))
            {
                <td>
                    @Html.ActionLink("Breyta", "Edit", new { id = item.ID, delete = false }) |
                    @Html.ActionLink("Eyða", "Edit", new { id = item.ID, delete = true });
                </td>
             }
        </tr>
    }
    </table>
}
else
{
    <p>Engir hlekkir</p>
}

